package com.birdy.redis;

import com.birdy.ws.util.SpringContext;
import io.lettuce.core.RedisClient;
import io.lettuce.core.api.reactive.RedisReactiveCommands;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author birdy
 * @date 2022/4/10 2:05 PM
 */
public interface RedisFactory {
    RedisConfig redisConfig = SpringContext.getBean(RedisConfig.class);
    static RedisReactiveCommands<String, String> getRedisCommand() {
        // 获取lettuce实例
        return RedisClient.create(redisConfig.getHost()).connect().reactive();
    }


}
